package ipe.dealer;

public class Player {
  String Name;
  long Balance;
  Inventory Sklad;
  
  
  
  public Player(String playerName, long initBalance){
	  Name = playerName;
	  Balance = initBalance;
	  Sklad = new Inventory();
  }


  public void pay(long sum){
	  Balance -= sum;
  }
  
  void buy(Day day,  String good, int amount){
	  int price=day.DataGrid.getUnitPrice(Game.ActualCity, good);
	  System.out.println("Price: "+price);

	  Sklad.toString();
	  Sklad.addItem(good, amount, price);

  
	  pay(price*amount);
	  day.DataGrid.removeGood(Game.ActualCity, good, amount);
	  
	  System.out.println("Kupil si si "+amount+" "+good+" po "+price);
	  System.out.println("Zostalo ti: "+Balance);
	  
	  


	  
  }

  void sell(String goodname, int amount){
	  
  }


  public void goTo(String city) {
	// TODO Auto-generated method stub
	Game.ActualCity = city;
  }
	
}
